<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>test</title>
</head>
<script>
    /**
     * 校验手机号
     */
    function checkMobile( strMobile )
    {	//13588888888
        var regu = /^[1][345678][0-9]{9}$/;
        var re = new RegExp(regu);
        if (re.test(strMobile)) {
            return true;
        }
        else {
            return false;
        }
    };
    function phoneCheck() {
        var phone = document.getElementById("phone").value;
        var phone_hint = document.getElementById("phone_hint");
        var flag = checkMobile(phone);
        if(flag) {
            phone_hint.innerHTML = "手机号格式正确";
            return true;
        } else {
            phone_hint.innerHTML = "手机号格式错误";
            return false;
        }
    }

    function phoneHide() {
        var phone = document.getElementById("phone");
    }
    function yzm() {
        alert("111")
    }

</script>
<body>

<p>手机号登录</p>
<form action="/e/user/phoneLogin" method="post">

    <div class="text">
        <p>手机号</p><br>
        <input id="phone" type="text" onblur="phoneHide()" onkeyup="phoneCheck()" Name="phone" placeholder="手机号" readonly="true" th:value="${phone}">
        <p>验证码</p><br>
        <input id="code" Name="code" type="text">
    </div>
    <input type="submit" value="登录">
</form>
<p>验证码</p>
<p th:text="${code}"></p>


</body>
</html>